package com.workpaper.app.plan.view.listener;

import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;

import com.workpaper.app.plan.business.DailyPlanBusiness;
import com.workpaper.app.plan.entity.DailyPlan;
import com.workpaper.app.plan.view.DailyPlanInfoDialog;
/**
 * 日常计划管理： 查看按钮监听处理
 * @author zyj
 *
 */
public class ShowDailyPlanInfoListener implements SelectionListener{

	@Override
	public void widgetSelected(SelectionEvent e) {
		Button btn = (Button) e.widget;
		String id = (String) btn.getData( );	//获取id
		
		DailyPlanBusiness dailyPlanBusiness = DailyPlanBusiness.getInstance();
		DailyPlan dailyPlan = dailyPlanBusiness.selectById(id);
		DailyPlanInfoDialog dialog = new DailyPlanInfoDialog(null, dailyPlan);
		dialog.open();
	}

	@Override
	public void widgetDefaultSelected(SelectionEvent e) {
		
	}

}
